<template>
    <div class="group">
        <h2>sd1的中嵌套路由的子组件 detail2 {{ route.params }}</h2>
        <div>
            <p>$route.params.title: {{ $route.params.title }}</p>
            <p>props: {{ props.title }}{{ props.content }}</p>
            <p style="background-color: cornflowerblue">detail2明明视图:{{ props.id }}</p>
        </div>
    </div>
</template>

<script setup lang='ts'>
import { useRoute } from 'vue-router';

const props = defineProps({
    id: String,
    title: String,
    content: String
})

const route = useRoute()

console.log(route.params, 'route.params 2') // 打印 params 参数
console.log(route.query, 'route.query 2')   // 打印 query 参数

</script>

<style lang="scss" scoped>
.group {
    margin: 10px;
    padding: 10px;
    border: 3px solid pink;
}
</style>